<template>
  <c-with-dialog
    ref="dialog"
    v-model="selections"
    multiple
    method="POST"
    :filters-raw="filtersRaw"
    :columns="columns"
    url="/api/v1/configArea/page"
    title="新增区域"
    :page-flag="false"
  >
    <template #btn>
      <c-button @click="cancelHandle">取消</c-button>
      <c-button type="primary" @click="confirmHandle">确认</c-button>
    </template>
  </c-with-dialog>
</template>
<script>
export default {
  name: 'AddArea',
  props: {
    filtersRaw: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      columns: [
        {
          prop: 'areaCode',
          label: '区域编码'
        },
        {
          prop: 'areaName',
          label: '区域名称'
        }
      ],
      selections: []
    }
  },
  methods: {
    selectionChange(v) {
      this.selections = v
    },
    confirmHandle() {
      this.$emit('on-change', this.selections)
      this.$refs.dialog.visible = false
    },
    cancelHandle() {
      this.$refs.dialog.visible = false
    }
  }
}
</script>
<style lang="scss" scoped>
.nctb{
  /deep/ .pagination-container{
    display: none !important;
  }
}
</style>
